
/**
 * @Title: PushTaskController.java
 * @Package com.py.credit.controller
 * @Description: TODO
 * Copyright: Copyright (c) 2020
 * Company:金电联行(江苏)信息技术有限公司
 * @author Comsys-jdzc
 * @date 2020年11月10日 上午10:11:57
 * @version V1.0
 */

package com.py.credit.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.py.credit.common.logs.ExceptionLogger;
import com.py.credit.common.rest.RestServiceResult;
import com.py.credit.service.PushtaskService;
import com.py.framework.core.annotation.IgnoreAuthority;

/**
 * @ClassName: PushTaskController
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author jdzc
 * @date 2020年11月10日 上午10:11:57
 *
 */
@RestController
@RequestMapping("/pushtask")
public class PushTaskController {
	@Autowired
	private PushtaskService pushtaskService;
	
	@IgnoreAuthority
	@RequestMapping(value = "/pushTask.do")
	public RestServiceResult<Object> upLoadFileTask() {
		RestServiceResult<Object> result = new RestServiceResult<Object>();
		try {
			Object data = pushtaskService.run();
			result.setData(data);
			return result;
		} catch (Exception e) {
			ExceptionLogger.error("BatchLogController#PushTaskController", "前置机数据推送定时任务异常！ERROR：" + e.getMessage(), e);
			result.setCode(RestServiceResult.CODE_UNKNOW);
			result.setMsg("前置机数据推送定时任务异常！");
			return result;
		}
	}

}
